using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class NotebookManager : MonoBehaviour
{
    public Transform commonEventTransform;
    public Transform specialEventTransform;

    private Image eventImage;

    private void OnEnable()
    {
        foreach (Transform child in commonEventTransform)
        {
            if (SwitchManager.GetSwitchState(child.name))
            {
                eventImage = child.GetComponent<Image>();
                eventImage.sprite = Resources.Load<Sprite>("Event/" + child.name);
            }
        }

        foreach(Transform child in specialEventTransform)
        {
            if (SwitchManager.GetSwitchState(child.name))
            {
                eventImage = child.GetComponent<Image>();
                eventImage.sprite = Resources.Load<Sprite>("Event/" + child.name);
            }
        }
    }
}
